<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('异常卡明细报表')"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="online-form">
                <div class="select-list">
                    <ul>
                        <li>
                        <li>
                            选择月份：<input type="text" name="datetimepicker" id="datetimepicker" class="" placeholder="月份"
                                        autocomplete="off" maxlength=7 onkeyup="value=value.replace(/^[1-2]\d{3}-((0[1-9])|(1[0-2]))$/,'')"/>
                        </li>
                        <li>
                            异常类型：<select id="state" name="state" class="form-control"></select>
                        </li>
                        <li>
                            使用单位：<select id="useCompany" name="useCompany" class="form-control">
                            <option value="">--请选择使用单位--</option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <!--        <div class="btn-group-sm" id="toolbar" role="group">-->
        <!--            <a class="btn btn-danger multiple disabled" onclick="javascript:batchForceLogout()"-->
        <!--               shiro:hasPermission="monitor:online:batchForceLogout">-->
        <!--                <i class="fa fa-sign-out"></i> 强退-->
        <!--            </a>-->
        <!--        </div>-->

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-export-js"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-select-js"/>

<th:block th:include="include :: datetimepicker-css"/>
2、
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
    var forceFlag = [[${@permission.hasPermi('monitor:online:forceLogout')}]];
    var prefix = ctx + "base_card";

    // $.modal.alertError('Hi，你好！')


    $(document).ready(function () {

        $.ajax({
            type: "GET",
            url: '/data_info/getCompany',
            dataType: "json",
            success: function (data) {
                $('#useCompany').select2({
                    data: data
                })
            },
            error: function (jqXHR) {
                console.log("Error: " + jqXHR.status);
            }
        });
    });


    $(function () {

        $('#datetimepicker').datetimepicker({
            format: 'yyyy-mm',
            weekStart: 1,
            autoclose: true,
            startView: 3,
            minView: 3,
            forceParse: false,
            language: 'zh-cn'
        });


        $('#state').select2({
            data: [
                {id: "0", text: "全部", selected: false, disable: true},
                {id: "2", text: "散卡", selected: false, disable: true},
                {id: "3", text: "僵尸卡", selected: false, disable: true},
                {id: "4", text: "无主卡", selected: false, disable: true},
                {id: "5", text: "零流量", selected: false, disable: true},
            ]
        })

        var options = {
            url: prefix + "/list",
            sortOrder: "desc",
            showFooter: false,
            showSearch: false,
            showRefresh: true,
            showToggle: false,
            showColumns: false,
            escape: false,
            columns: [{
                checkbox: true
            },
                {
                    title: "序号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field: 'cardNo',
                    title: 'SIM卡号',
                    // sortable: true
                },
                {
                    field: 'flow',
                    title: '流量'
                },
                {
                    field: 'charge',
                    title: '资费'
                },
                {
                    field: 'stateName',
                    title: '异常类型',
                },
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function (value, row, index) {
                //         var msg = '<a class="btn btn-danger btn-xs ' + forceFlag + '" href="javascript:void(0)" onclick="forceLogout(\'' + row.sessionId + '\')"><i class="fa fa-sign-out"></i>强退</a> ';
                //         return msg;
                //     }
                // }
            ]
        };
        $.table.init(options);
    });

</script>
</body>
</html>